import App from './App.vue'
import router from './router'
import '../static/icon/iconfont.css'
import './assets/common.css'
import common from "./assets/common";
import api from "./api";
import store from "./utils/vuex/store";
import session from "./utils/storage/session";
// import encrypt from "./utils/encrypt";

Vue.config.productionTip = false
Vue.prototype.$common = common
Vue.prototype.$api = api
Vue.prototype.$store = store
Vue.prototype.$session = session
// Vue.prototype.$encrypt = encrypt
Vue.prototype.openLoading = function () {
  const loading = this.$loading({      // 声明一个loading对象
    lock: true,                                // 是否锁屏
    text: 'Loading...',                        // 加载动画的文字
    // spinner: 'el-icon-loading',             // 引入的loading图标
    background: 'rgba(f, f, f, 0.8)',          // 背景颜色
    target: document.querySelector('.loading'),  // 需要遮罩的区域
  })
  setTimeout(function () {             // 设定定时器，超时5S后自动关闭遮罩层，避免请求失败时，遮罩层一直存在的问题
    loading.close();                           // 关闭遮罩层
  }, 5000)
  return loading;
}

new Vue({
  el: '#app',
  router,
  components: {App},
  template: '<App/>'
})
